<div class="cate">
  <!-- 添加分类按钮 -->
  <el-button plain type="success" @click='showAddCateDialog'>添加分类</el-button>
  <!-- 表格 -->
  <el-table
  :data="cateList"
  style="width: 100%">
  <!--
    treeKey='cat_id'// 展开单个子菜单
    parentKey='cat_pid'// 收起子菜单
    levelKey='cat_level'//显示层级
    :indentSize='20'//缩进的像素
  -->
  <el-table-tree-column
  :indentSize='20'
  levelKey='cat_level'
  treeKey='cat_id'
  parentKey='cat_pid'
  file-icon="icon icon-file"
  folder-icon="icon icon-folder"
  prop="cat_name" label="分类名称" width="220"></el-table-tree-column>
  <!-- <el-table-column
    prop="cat_name"
    label="分类名称"
    width="180">
  </el-table-column> -->
  <el-table-column
    prop="cat_deleted"
    label="是否有效"
    width="180">
    <template slot-scope="scope">
      {{ scope.row.cat_deleted ? '否' : '是' }}
    </template>
  </el-table-column>
  <el-table-column
    prop="cat_level"
    label="排序">
  </el-table-column>
  <el-table-column
    label="操作">
    <template slot-scope="scope">
      <el-button size="mini" plain type="primary" icon="el-icon-edit"></el-button>
      <el-button size="mini" plain type="danger" icon="el-icon-delete"></el-button>
    </template>
  </el-table-column>
  </el-table>
  <!-- 分页 -->
  <el-pagination
    @current-change='currentChange'
    background
    layout="prev, pager, next"
    :total="total">
  </el-pagination>
<!-- 展示添加分类对话框 -->
<el-dialog title="添加分类" :visible.sync="isShowAddCateDialog">
    <el-form :model="cateForm" label-width="80px">
      <el-form-item label="分类名称">
        <el-input v-model="cateForm.cat_name"></el-input>
      </el-form-item>
      <el-form-item label="父级名称">
        <!-- //需要发送求此部分数据 -->
            <el-cascader
              v-model="cateForm.cat_pid_arr"
              :props="{ value: 'cat_id', label: 'cat_name' }"
              :options="addCateForm"
              change-on-select
            ></el-cascader>
        <!-- <el-select v-model="cateForm.cat_pid" placeholder="请选择活动区域">
          <el-option label="区域一" value="shanghai"></el-option>
        </el-select> -->
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="isShowAddCateDialog = false">取 消</el-button>
      <el-button type="primary" @click="addCate">确 定</el-button>
    </div>
  </el-dialog>
</div>
